function decompressComponent(base64Str) {
    const binaryStr = atob(base64Str);
    const array = new Uint8Array(binaryStr.length);
    for (let i = 0; i < binaryStr.length; i++) {
        array[i] = binaryStr.charCodeAt(i);
    }
    const result = pako.ungzip(array, { to: 'string' });
    return result;
}
function compressComponent(componentStr) {
    const dataArray = new TextEncoder().encode(componentStr);
    const compressed = pako.gzip(dataArray, { level: 9 }); // 最大压缩级别
    return btoa(String.fromCharCode.apply(null, new Uint8Array(compressed)));
}

const componentCode = `
<template component>
    <style>
        .shadow-button {
            background-color: #4caf50;
            border: none;
            color: white;
            padding: 15px 32px;
            text-align: center;
            text-decoration: none;
            display: inline-block;
            font-size: 16px;
            border-radius: 10px;
            box-shadow: 0px 8px 16px rgba(0, 0, 0, 0.2);
            cursor: pointer;
        }
        .shadow-button:hover {
            opacity: 0.8;
        }

        .shadow-button:active {
            transform: translateY(4px);
            box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.2);
        }
    </style>

    <button class="shadow-button">
        <slot></slot>
    </button>

    <script>
        export default {
            tag: 'simple-button'
        }
    </script>
</template>
`;


